<?php

namespace common\Table\Helper;

class partition {
    private $_table;
    
    public function setTable($table) {
        return $this->_table = $table;
    }
    
    public function getPartitionMaxNum() {
        return $this->db->getPartitionMaxNum($this->_table);
    }
    
    public function addPartition($partitionName, $lessThan, $partitionPre = 'p') {
        return $this->db->exec("ALTER TABLE ". $this->_table ." ADD PARTITION (PARTITION {$partitionPre}$partitionName VALUES LESS THAN ($lessThan));");
    }
}